<!--
/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright 2014 The moOde audio player project / Tim Curtis
*/
-->
<div id="container">
<div class="container">
	<h1 class="lib-config">本地 NVMe 驱动器</h1>
	<p>
		从列表中选择一个格式化为 EXT4 的 NVMe 驱动器进行挂载。
		保存或移除驱动后，返回到播放或库，选择菜单中的“更新库”。
	</p>

	<form class="form-horizontal" action="lib-config.php" method="post">
		<legend>NVMe 源
			<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save_nvme_source" value="1">保存</button>
			<a href="#remove-nvme-mount" data-toggle="modal" class="$_hide_remove_nvme_source"><button class="legend-config btn btn-medium btn-primary">移除</button></a>
		</legend>

		<a data-toggle="modal" href="#moode-log" $_hide_nvme_mount_error>
			<button class="btn btn-medium btn-primary config-btn">
				$_nvme_mount_error_msg
			</button>
		</a>

		<div class="control-group">
			<label class="control-label" for="nvme-drive">驱动器</label>
			<div class="controls">
				<select id="nvme-drive" name="mount[drive]" class="config-select-large">
					$_nvme_drives
				</select>
				<a aria-label="帮助" class="config-info-toggle" data-cmd="info-nvme-drives" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-nvme-drives" class="config-help-info">
					显示 NVMe 驱动器的设备 ID 列表，并在括号中显示其卷标或状态，例如“未格式化”或“无标签”。
                </span>
			</div>

			<label class="control-label" for="nvme-name">名称</label>
			<div class="controls">
				<input class="config-input-large" type="text" pattern="[A-Za-z0-9\-]{1,25}" id="nvme-name" name="mount[name]" value="$_name">
				<input type="hidden" name="mount[id]" value="$_id">
				<input type="hidden" name="mount[action]" value="$_action">
				<a aria-label="帮助" class="config-info-toggle" data-cmd="info-nvme-name" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-nvme-name" class="config-help-info">
					此 NVMe 驱动器的友好名称（别名）。该名称将在库文件夹视图的 NVME 文件夹下显示。
					格式为 1-25 个字符，允许字母数字和连字符。
                </span>
			</div>
		</div>
	</form>
</div>
</div>

<form class="form-horizontal" method="post">
	<div id="remove-nvme-mount" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="remove-nvme-mount-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>移除 NVMe 挂载：$_name?</h3>
		</div>
		<div class="modal-body"></div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="remove_nvme_source" value="1">是</button>
		</div>
	</div>
</form>

<div id="moode-log" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="moode-log-label" aria-hidden="true">
	<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3>Moode 日志</h3>
	</div>
	<div class="modal-body">
		<pre>
			$_moode_log
		</pre>
	</div>
	<div class="modal-footer">
		<button class="btn singleton" data-dismiss="modal" aria-hidden="true">关闭</button>
	</div>
</div>
